package org.test.character.ssltest;

import java.io.PrintStream;
import java.net.ServerSocket;
import java.net.Socket;

import javax.net.ssl.SSLServerSocketFactory;

public class ServerSSL {

	public static void main(String args[ ]) throws Exception{
        System.setProperty("javax.net.ssl.keyStore",
"d:/mykeystore");
        System.setProperty("javax.net.ssl.keyStorePassword",
"3108006456");
        SSLServerSocketFactory ssf=(SSLServerSocketFactory)
 SSLServerSocketFactory.getDefault( );
         ServerSocket ss=ssf.createServerSocket(5410);
	     System.out.println("Waiting for connection...");
         while(true){
	   		Socket s=ss.accept( );
	   		PrintStream out = new PrintStream(s.getOutputStream( ));
	   		out.println("hello");
	   		out.close( );
            s.close( );
        }
  }
}
	
